//
//  BaseViewController.m
//  SameWorld(merchant)
//
//  Created by 李小朋 on 2017/3/29.
//  Copyright © 2017年 杨旭. All rights reserved.
//

#import "BaseViewController.h"
#import "UIBarButtonItem+Extension.h"
@interface BaseViewController ()

@end

@implementation BaseViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.translucent = YES;
    
    
    //1.1.1 在具有导航栏的viewController中设置导航栏透明
    [self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:0];
    //这一个方法是将导航栏与主view之间的那个阴影线消除，将导航栏和view无缝连接
    [self.navigationController.navigationBar setShadowImage:[UIImage new]];
    
    [self.navigationController.navigationBar setTranslucent:NO];
    
  
//    //1.1.2 在创建的总导航栏控制器 或者在AppDelegate中设置导航栏透明
//    [[UINavigationBar appearance] setShadowImage:[UIImage new]];
//    
//    [[UINavigationBar appearance]  setTranslucent:NO];
    
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem  itemWithTitle:@"返回" ImageName:@"fanhui" highImageName:nil target:self action:@selector(leftBarButtonItem:)];
    

}


- (void)leftBarButtonItem:(UIBarButtonItem *)sender {
    
    [self.navigationController popViewControllerAnimated:YES];
}





-(void)showAlertWith:(NSString *)messge {
    
    UIAlertController *alertController = [UIAlertController alertControllerWithTitle:messge message:@"" preferredStyle:(UIAlertControllerStyleAlert)];
    
    UIAlertAction *alert = [UIAlertAction actionWithTitle:@"确定" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
        
    }];
    
    [alertController addAction:alert];
    
    [self presentViewController:alertController animated:YES completion:nil];
    
}




-(void)showAlertWithTitle:(NSString *)title {
    
    CustomAlertActionView *alertView = [[CustomAlertActionView alloc] initWithViewType:(AlertTypeNotButton)];
    alertView.title = title;
    [alertView show];
    
}


@end
